using System;
using System.Collections.Generic;

namespace Xfinity.Collections
{
    public class GraphNode<T>   
    {
        public GraphNode()
        {
            connectedNodes = new List<GraphNode<T>>();
            node = default(T);
        }
        public GraphNode(T value)
        {
            node = value;

        }
        public GraphNode(T value, IEnumerable<GraphNode<T>> connectedNodes)
        {
            node = value;
            this.connectedNodes.AddRange(connectedNodes);
        }
        private List<GraphNode<T>> connectedNodes;

        /// <summary>
        /// 
        /// </summary>
        public List<GraphNode<T>> ConnectedNodes
        {
            get { return connectedNodes; }
        }

        private T node;

        /// <summary>
        /// 
        /// </summary>
        public T NodeValue
        {
            get { return node; }
            set { node = value; }
        }
    }

    public class Graph<T>
    {
        public Graph()
        {
            rootNode = new GraphNode<T>();
        }
        public Graph(T value)
        {
            rootNode = new GraphNode<T>(value);
        }
        
        private GraphNode<T> rootNode;

        /// <summary>
        /// 
        /// </summary>
        public GraphNode<T> RootNode
        {
            get { return rootNode; }
            set { rootNode = value; }
        }	
    }
}
